
//
//  MovieCollectionCell.m
//  DSYDouban
//
//  Created by dllo on 16/1/3.
//  Copyright © 2016年 lanou3g. All rights reserved.
//

#import "MovieCollectionCell.h"

@interface MovieCollectionCell ()


@end

@implementation MovieCollectionCell

- (void)dealloc
{
    [_movieImageView1 release];
    [_movieImageView2 release];
    [_movieImageView3 release];
    
    [_movieNameLabel1 release];
    [_movieNameLabel2 release];
    [_movieNameLabel3 release];
    
    [super dealloc];
    
}


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self create];
    }
    return self;
}

- (void)create {
    
    self.movieImageView1 = [[UIImageView alloc] init];
    [self.contentView addSubview:_movieImageView1];
    [_movieImageView1 release];
    
    self.movieImageView2 = [[UIImageView alloc] init];
    [self.contentView addSubview:_movieImageView2];
    [_movieImageView2 release];
    
    self.movieImageView3 = [[UIImageView alloc] init];
    [self.contentView addSubview:_movieImageView3];
    [_movieImageView3 release];
    
    
    self.movieNameLabel1 = [[UILabel alloc] init];
    [self.contentView addSubview:_movieNameLabel1];
    [_movieNameLabel1 release];
    
    self.movieNameLabel2 = [[UILabel alloc] init];
    [self.contentView addSubview:_movieNameLabel2];
    [_movieNameLabel2 release];
    
    self.movieNameLabel3 = [[UILabel alloc] init];
    [self.contentView addSubview:_movieNameLabel3];
    [_movieNameLabel3 release];
    
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    CGFloat intervalWidth = 20.0;
    CGFloat content_W = self.contentView.frame.size.width;
//    CGFloat content_H = self.contentView.frame.size.height;
    
    CGFloat imageviewWidth = (content_W - 4 * intervalWidth) / 3;
    
    _movieImageView1.frame = CGRectMake(intervalWidth, 10, imageviewWidth, imageviewWidth * 1.2);
//    _movieImageView1.backgroundColor = [UIColor greenColor];
    _movieNameLabel1.frame = CGRectMake(intervalWidth, 10 + imageviewWidth * 1.2, imageviewWidth, 50);
//    _movieNameLabel1.backgroundColor = [UIColor greenColor];
    _movieNameLabel1.numberOfLines = 0;
    _movieNameLabel1.font = [UIFont systemFontOfSize:14.0];
    
    _movieImageView2.frame = CGRectMake(intervalWidth * 2 + imageviewWidth, 10, imageviewWidth, imageviewWidth * 1.2);
//    _movieImageView2.backgroundColor = [UIColor greenColor];
    _movieNameLabel2.frame = CGRectMake(intervalWidth * 2 + imageviewWidth, 10 + imageviewWidth * 1.2, imageviewWidth, 50);
//    _movieNameLabel2.backgroundColor = [UIColor greenColor];
    _movieNameLabel2.numberOfLines = 0;
    _movieNameLabel2.font = [UIFont systemFontOfSize:14.0];
    
    _movieImageView3.frame = CGRectMake(intervalWidth * 3 + 2 * imageviewWidth, 10, imageviewWidth, imageviewWidth * 1.2);
//    _movieImageView3.backgroundColor = [UIColor greenColor];
    _movieNameLabel3.frame = CGRectMake(intervalWidth * 3 + 2 * imageviewWidth, 10 + imageviewWidth * 1.2, imageviewWidth, 50);
//    _movieNameLabel3.backgroundColor = [UIColor greenColor];
    _movieNameLabel3.numberOfLines = 0;
    _movieNameLabel3.font = [UIFont systemFontOfSize:14.0];
    
    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
